Categorizing memory pages based on page residences

ABSTRACT

Embodiments of the present invention provide hints for page stealing by prioritizing pages based on the number of residences. Receiving a plurality of pages to be hinted to a hypervisor for page stealing. Determining at least two page types of the plurality of pages. Determining whether any of the at least two page types has a total number of residences less than a total number of potential residences in the virtual environment for all page types and have a total number of residences less than a threshold. Responsive to determining a first page type of the at least two page types has a total number of residences less than a total number of potential residences for all page types and has a total number of residences less than a threshold, notifying the hypervisor of at least one page from the plurality of pages that is the determined first page type.

BACKGROUND

The present disclosure relates generally to the field of memoryvirtualization, and more particularly to categorizing page types basedon the number of residences for hypervisor page stealing.

In computing, virtual memory is a memory management technique that isimplemented using both hardware and software. It maps memory addressesused by a program, called virtual addresses, into physical addresses incomputer memory. In addition, paging is one of the memory managementschemes by which a computer can store and retrieve data from secondarystorage for use in main memory. In the paging memory management scheme,the operating system retrieves data from secondary storage in same-sizeblocks called pages. Paging allows operating systems to use secondarystorage for data that does not fit into physical random-access memory(RAM).

Page tables are used to translate the virtual addresses seen by theapplication into physical addresses used by the hardware to processinstructions and such hardware that handles this specific translation isoften known as the memory management unit. Each entry in the page tableholds a flag indicating whether the corresponding page is in real memoryor in another location. The page table entry will contain the realmemory address at which the page is stored. Systems can have one pagetable for the whole system, separate page tables for each applicationand segment, a tree of page tables for large segments, or a combinationof these.

Active memory sharing (AMS) is a memory virtualization technology thatallows multiple partitions to share a pool of physical memory. This isdesigned to increase system memory utilization, thereby enabling a userto realize a cost benefit by reducing the amount of physical memoryrequired. When all physical memory is already in use, the pagingsupervisor, often called a hypervisor, must free a page in primarystorage to hold the swapped-in page, or page that needs to be inphysical memory. The hypervisor uses one of a variety of pagereplacement algorithms such as least recently used (LRU) or a kernelpredetermine order like read-only file pages, dirty file pages, clientpages, working pages, and klock pages to determine which page to free.

SUMMARY

Embodiments of the present invention include a method, computer programproduct, and system for providing hints for page stealing byprioritizing pages based on the number of residences for the pages in avirtual environment. In one embodiment, a plurality of pages that arecandidates to be hinted to a hypervisor for page stealing is received.At least two page types of the plurality of pages is determined. Whetherany of the at least two pages types has a total number of residencesless than a total number of potential residences in the virtualenvironment for all page types and has a total number of residences lessthan a threshold is determined. Responsive to determining a first pagetype of the at least two page types has a total number of residence lessthan a total number of potential residences in the virtual environmentfor all page types and has a total number of residences less than athreshold, the hypervisor is notified of at least one page from theplurality of pages that is of the determined first page type.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an environment, in accordancewith an embodiment of the present invention;

FIG. 2 is an example of a paging device table entry in accordance withan embodiment of the present invention;

FIG. 3 is a flowchart depicting the operational steps of a programfunction, on a computer system within the environment of FIG. 1, inaccordance with an embodiment of the present invention; and

FIG. 4 depicts a block diagram of components of the computer systemexecuting the program function, in accordance with an embodiment of thepresent invention.

DETAILED DESCRIPTION

Collaborative memory manager (CMM) 130 provides hints to hypervisor 124for page stealing in a virtual environment. However, currently thesehints are determined by algorithms that don't take into account thenumber of residences of a page. An increased number of residences for apage allows for paging strategies of each residence to move the pagemultiple times and in the process, over utilizing a shared memory poolleading to bottle necks and slower system processing. Embodiments of thepresent invention recognize that by categorizing page types based uponthe number of residences and then hinting to the hypervisor based uponthe results, certain instances of page movements that can take upvaluable system resources can be eliminated.

Embodiments of the present invention also recognize that applicationsare impacted by the operating system and hypervisor page stealing. Theapplication's performance is impacted by both the steal time taken andalso by the number of ways the stealing of the same page is happening atthe same time. When an application is trying to access a piece of data,time is spent in managing memory and its content in different storagelocations in the system and paging that piece of data into main memory.Pages can be stealed by multiple strategies (e.g., hypervisor pagingstrategies, Operating System “OS” paging strategies, NFS (Network FieSystem) paging strategy, Persistent Data paging strategy, etc.) causingunnecessary movement of pages from one storage location to anotherstorage location without gaining any benefit.

Embodiment of the present invention also recognize the followingdisadvantages: i) hypervisor thrashing in stealing of pages, ii)temporarily freeing pages in Main Memory to accommodate the page'smovement from one location to another exerting capacity pressure on MainMemory, and iii) delays in moving a piece of data to a destinationlocation due to transferring from source location to an intermediatelocation before reaching a final destination location.

Embodiments of the present invention will now be described in detailwith reference to the Figures. FIG. 1 is a block diagram illustrating anenvironment, generally designated 100, in accordance with one embodimentof the present invention.

Environment 100 includes computer system 102 and remote file system disk106, 110 and 114, all interconnected over network 104. Network 104 canbe, for example, a local area network (LAN), a wide area network (WAN)such as the Internet, or a combination of the two, and can includewired, wireless, or fiber optic connections. Network 104 may be adistributed computing environment utilizing clustered computers andcomponents that act as a single pool of seamless resources, as is commonin data centers and with cloud computing applications or “clouds”. Ingeneral, network 104 can be any combination of connections and protocolsthat will support communications between computer system 102 and remotefile system disk 106, 110, 114. For ease of discussion, reference nowwill only be made to remote file system disk 106 but shall include theplurality of remote file system disks 106, 110, 114, all having the samecharacteristics.

In various embodiments of the present invention, computer system 102 maybe a laptop computer, tablet computer, netbook computer, personalcomputer (PC), a desktop computer, a personal digital assistant (PDA), asmart phone, or any programmable electronic device capable ofcommunicating with remote file system disk 106 via network 104. Computersystem 102 includes remote file system disk 120, hypervisor 124, sharedmemory pool 126 and collaborative memory manager (CMM) 130.

Remote File system disk 120 is a computer-readable storage media thatincludes a file system (not shown) that is used to control how data isstored and retrieved. The file system is program responsible fororganizing files and directories, and keeping track of which areas ofthe media belong to which file and which areas are not being used. In anembodiment, remote file system disk 120 is a magnetic hard disk drive.Alternatively, or in addition to a magnetic hard disk drive, remote filesystem disk 120 can include a solid state hard drive, a semiconductorstorage device, read-only memory (ROM), erasable programmable read-onlymemory (EPROM), flash memory, or any other computer-readable storagemedia that is capable of storing program instructions or digitalinformation. In yet another alternative, remote file system disk 120 ispersistent storage 408, discussed later.

Remote File system disk 120 includes paging space 122. Paging space 122is a type of logical volume with allocated disk space from remote filesystem disk 120 that stores information that corresponds to an areamapped in virtual memory but is not currently being accessed by mainmemory. In an embodiment, main memory is RAM 414. In an alternativeembodiment, main memory may be dedicated to a LPAR or shared betweenLPARS (Active Memory Shared Pool). This logical volume has an attributetype equal to paging, wherein paging is one of the memory managementschemes by which a computer can store or retrieve data from secondarystorage for use in main memory, and is usually simply referred to aspaging space or swap space. When the amount of free main memory incomputer system 102 is low, programs or data that have not been usedrecently are moved from main memory to paging space 122 to release mainmemory for other activities.

Hypervisor 124 provides the ability to divide physical computing systemresources into isolated logical partitions. In an embodiment, hypervisor124 manages shared memory pool 126. Logical partitioning is the abilityto logically divide a real, or physical, resource into two or moreindependent resources, and one or more applications execute in eachvirtual machine or logical partition as if the virtual machine orlogical partition was a separate physical computer. Each logicalpartition, also called a virtual system, virtual server, or virtualmachine, operates like an independent computing system running its ownoperating system. Hypervisor 124 can allocate dedicated processors, I/Oadapters, and memory to each virtual machine and can also allocateshared processors to each virtual machine. In some manners ofvirtualization, the hypervisor 124 creates a shared processor pool fromwhich hypervisor 124 allocates time slices of virtual processors to thevirtual machines according to predetermined allocation percentages. Inother words, hypervisor creates 124 virtual processors from physicalprocessors so that virtual machines can share the physical processors,which includes sharing cache space and memory bandwidth, while runningindependent operating environments.

Shared memory pool 126 is a collection of physical memory blocks thatare managed as a whole by hypervisor 124. Shared memory pool 126 isshared by multiple paging spaces, for example paging space 122, and usedto move applications or data from main memory to any number of pagingspaces, or vice versa. For example, a page may be moved from main memoryto paging space 122 and this operation involves moving the page frommain memory to shared memory pool 126 and then to paging space 122. Atthe same time, a page may be moved from paging space 108 to main memoryand this operation involves moving the page from paging space 108 toshared memory pool 126 and then to main memory. In an alternativeembodiment, these two operations may happen directly before or after oneanother and the same physical memory blocks in shared memory pool 126may be used. In other words, each paging space can use the same physicalmemory blocks.

In an embodiment, shared memory pool 126 is allocated physical memoryblocks from RAM 414. In an alternative embodiment, shared memory pool126 is allocated physical memory blocks from file system disk 120. Inyet another embodiment, shared memory pool 126 is allocated physicalmemory blocks from its own separate computer-readable storage medium(not shown). The size of shared memory pool 126 can be dynamicallychanged at any time by CMM 130. Shared memory pool 126 can grow up tothe maximum system memory available for logical partition use, in otherwords the maximum size of the computer-readable storage medium beingused, and can be reduced to release additional memory to other memorypartitions of the computer-readable storage medium. Shared memory pool126 is used to move applications or data from main memory to pagingspace 122, or any other paging space, or vice versa.

CMM 130 is an operating system program that provides hints about memorypage usage to hypervisor 124 so that hypervisor can target pages to swapin or out of main memory. CMM 130 also includes OS paging device 132. Inan alternative embodiment, CMM 130 is an operating system feature orfunction. CMM 130 is designed to manage shared memory pool 126 acrossall partitions or paging spaces that have use of shared memory pool 126.However, CMM 130 does not have a view of the hot (active) and cold(aged) paging space 122 of file system disk 120 or any paging space(s)of any storage media(s). OS paging device 132, an operating systemfeature or function, notifies CMM 130 of hotness or coldness of pagesfound in paging space 122 or any other paging space found in environment100. For example, paging space 108, 112, 116 found on remote file systemdisk 106, 110, 114, respectively. CMM 130 uses the information providedby OS paging device 132 to provide hints, discussed previously, tohypervisor 124 to target memory pages for swap in increasing order ofimportance based on the hints.

Computer system 102 may include internal and external hardwarecomponents, as depicted and described in further detail with respect toFIG. 4.

FIG. 2 shows paging device table entry 200 and an example of potentialpaging device table entry in accordance with an embodiment of thepresent invention. Each paging device table entry 200 will have anassociated OS paging device, such as OS paging device 132 and anassociated paging space, such as paging space 122. Paging device tableentry 200 is stored in the paging device table entry's associated pagingspace, such as paging space 122. It should be noted that paging devicetable entry 200 is being used as an example, the location of thedescription information found on paging device table entry 200 is anembodiment of the present invention, and all description information maybe found at any location within paging device table entry 200. There areseveral types of page tables including an inverted page table,multilevel page table, virtualized page table, and nested page table. OSpaging device 132 updates all the descriptions, as described below, whenpaging device table entry 200 is created or modified.

The first description is for the type of device. For example, log,paging, remote file system, or local file system. There can be anynumber of log, paging, remote file systems, or local file systems andeach can be named individually. The second description is for thepending input/output (i/o) count. The pending i/o count is total numberof input/output, e.g., read/write operations for the paging device. Thecount is dynamically changing as more input/output operations arecompleted and/or added to the queue. The third description is for thei/o list head. The i/o list head is the first operation listed in thepending i/o count. In other words, the i/o list head is the nextoperation to be input/output. When this operation has been completedthere is a new i/o list head that is the next operation to beinput/output. The fourth description is for the i/o list tail. The i/olist tail is the last operation listed in the pending i/o count. Inother words, the i/o list tail is the last operation to be input/output.When a new operation is added to the pending i/o count, the newoperation becomes the i/o list tail. The fifth description is the pagerstrategy routine address. The pager strategy routine address is afunction that is registered to a specified I/O sub system within theoperating system. An example would be the NFS having its own strategy tosync NFS pages to NFS server. The operating system stores the address ofthe specified device during initialization of the I/O subsystempertaining to the specified device in paging device table entry 200.When an I/O request is made, the operating system invokes the pagingstrategy of the specified device as indicated in paging device tableentry 200.

In an embodiment of the invention, paging device table entry 200 alsoincludes readable residences, writeable residences, intermediate arrivalcount just to page out, and varying residence. The first description isreadable residences and indicates the number of locations that a pagecan be read from. The second description is writeable residences andindicates the number of locations that a page can be written to. Thethird description is intermediate arrival count just to page out andindicates whether a page, when being paged or swapped out, must arriveat an intermediate location, in this embodiment shared memory pool 126.The fourth description is varying residence and indicates that thenumber of residences for a page pertaining to this paging device tableentry dynamically changes.

FIG. 3 is a flowchart depicting workflow 300 which includes operationalsteps of CMM 130 for providing hints to hypervisor 124 for page stealingby categorizing page types based upon the number of residences, inaccordance with an embodiment of the present invention.

CMM 130 determines pages to relocate based upon least recently used(LRU) algorithm (step 302). Here, a program tries to access a page(s)that are not currently mapped to main memory. This situation is known asa page fault. CMM 130 then takes control to handle the page fault, in amanner invisible to the original program that is trying to access thepage. Therefore, CMM 130 must determine the location of the page that istrying to be accessed in secondary storage, for example, on file systemdisk 120. The page may be found on file system disk 120 or directly inpaging space 122 located on file system disk 120. Secondary storage mayalso be remote file system disk 106, 110, 114, and the associated pagingspace 108, 112, 116, respectively. Next, CMM 130 must obtain an emptypage from main memory to use as the container for the retrieved page tobe located.

To obtain an empty page from main memory, CMM 130 must relocate a pagethat is located in main memory and to determine which page to relocate,CMM 130 uses a LRU algorithm. The LRU algorithm determines the leastrecently used page as the page to relocate first. This algorithmrequires keeping track of what was used when. In an alternativeembodiment, CMM 130 may use Bélády's algorithm, most recently used (MRU)algorithm, pseudo-LRU (PLRU) algorithm, random replacement (RR)algorithm, segmented LRU (SLRU) algorithm, or any other algorithm asknown in the art and suitable for the foregoing intended use. CMM 130will determine a number of pages that are potential candidates forhinting to hypervisor 124 to be taken from main memory to handle thepage fault.

CMM 130 determines the page types for the determined pages to relocated(step 304). CMM 130 performs an analysis of all the pages that have beendetermined, in the previous step, as possible candidates to relocate andcreates a list of all of the page types found in all the pages. In otherwords, there may be a total of seven pages but there may only be fourpage types from the seven pages. The possible page types include, butare not limited to, Klock (Kernel pages), working segment pages, remotepages (e.g., networked file system or short-term network file system),and persistent pages. For example, there may be three working segmentpages, two persistent pages, two remote networked file system pages anda single remote short-term network file system page.

CMM 130 selects a page type from the list of page types (step 306). Asdiscussed in the previous step, there are a number of page types for thepages that have been determined as potentials to be swapped, and step306 is the first step in a loop that will analyze each page type. Thepage type to be analyzed can be determined by a user input. In otherwords, a user can select a page type to analyze first, second, third,etc. until all page types have been put in an order of analysis. In analternative embodiment, a user or administrator may notify CMM 130 of apredetermined order of page types to analyze. In doing so, CMM 130performs this step without input from a user during the analysisprocess. For example, CMM 130 selects working segment pages as the firstpage type to analyze due to a predetermined ordering of page types toanalyze.

CMM 130 determines if the number of residences for the page type is lessthan the total number of potential residences for all pages in theenvironment (decision block 308). The number of residences for the pagetype is determined from the paging device table entry for that page typeby taking the sum of the readable residences and writeable residences.In an embodiment, environment 100 includes a total of six potentialresidences: paging space 108, 112, 116, 122, shared memory pool 126, andmain memory. Alternatively, there may be any number of potentialresidence for all pages in the environment.

If the number of residences for the page type is more than the totalnumber of potential residences for all pages in the environment(decision block 308, no branch), then CMM 130 adds the page type to the“Skip” list (step 310). The “Skip” list (not shown) is a list of thepage types that CMM 130 has determined should not be hinted tohypervisor 124 as potential candidates to be swapped. If the number ofresidences for the page type is less than the total number of potentialresidences for all pages in the environment (decision block 308, yesbranch), then CMM 130 adds the page type to the “Hot Page Out” list(step 312). The “Hot Page Out” list (not shown) is a list of the pagetypes that CMM 130 has determined can be hinted to hypervisor 124 aspotential candidates to be swapped.

Upon completion of either step 310 or step 312, CMM determines if allpage types, from the list of page types, have been processed (decisionblock 314). If all page types have not been processed (decision block314, no branch), then CMM 130 selects another page type from the list ofpage types to process (step 306).

If all page types have been processed (decision block 314, yes branch),then CMM 130 determines the page types in the “Hot Page Out” list (step316). Similar to step 304, CMM 130 performs an analysis of all the pagetypes that have been added to “Hot Page Out” list as possible candidatesto relocate and creates a list of all the pages that are possiblecandidates to relocate. In other words, there may be three page typesbut a total of five pages that are potential pages to be relocated.

CMM 130 selects a page type from the list of determined page types (step318). As discussed in the previous step, there are a number of pagetypes for the pages that have been determined as potentials to beswapped, and step 318 is the first step in a loop that will analyze eachpage type. For example, CMM 130 selects working segment pages as thefirst page type to analyze.

CMM 130 determines if the number of residences for the page type isgreater than the threshold page residences (decision block 320). Thenumber of residences for the page type is determined from the pagingdevice table entry for that page type by taking the sum of the readableresidences and writeable residences. In an embodiment, the thresholdpage residences is determined by the administrator of environment 100.In an alternative embodiment, the threshold page residences may bedetermined by the OS. For example, the administrator may determine thethreshold page residences is three page residences.

If the number of residences for the page type is more than the thresholdpage residences (decision block 320, yes branch), then CMM 130 adds thepage type to the “Skip” list (step 322). The “Skip” list (not shown) isa list of the page types that CMM 130 has determined should not behinted to hypervisor 124 as potential candidates to be swapped, asdiscussed previously. If the number of residences for the page type isless than the threshold page residences (decision block 320, no branch),then CMM 130 adds the page type to the “Page Types to be Stealed” list(step 324). The “Page Types to be Stealed” list (not shown) is a list ofthe page types that CMM 130 has determined will be hinted to hypervisor124 as potential candidates to be swapped.

Upon completion of either step 322 or step 324, CMM determines if allpage types, from the list of page types, have been processed (decisionblock 326). If all page types have not been processed (decision block326, no branch), then CMM 130 selects another page type from the list ofpage types to process (step 318).

If all page types have been processed (decision block 326, yes branch),then CMM 130 determines the page that have page types present in the“Page Types to be Stealed” list (step 328). In other words, CMM 130reviews the pages determined to be relocated in step 302, and thendetermines which of those pages have page types present in the “PageTypes to be Stealed” list. For example, only one page type may bepresent in the “Page Types to be Stealed” list and there may be twopages that have been determined as potential candidates to be relocatedthat are of that page type.

CMM 130 sends the determined pages information to hypervisor 124 (step330). CMM 130 provides hypervisor 124 with hints about the determinedpages that can be stealed. In other words, CMM 130 has found moreoptimal candidate pages to be swapped as compared to just usingalgorithms, as discussed in step 302, and CMM 130 notifies hypervisor124 of the optimal candidate pages. Hypervisor 124 now performs standardswapping operations with the information about optimal candidates, asknown in the art.

FIG. 4 depicts a block diagram of components of computer system 102 inaccordance with an illustrative embodiment of the present invention. Itshould be appreciated that FIG. 4 provides only an illustration of oneimplementation and does not imply any limitations with regard to theenvironments in which different embodiments may be implemented. Manymodifications to the depicted environment may be made.

A non-transitory computer readable storage medium embodiment herein isreadable by a computerized device. The non-transitory computer readablestorage medium stores instructions executable by the computerized deviceto perform a method that tests integrated circuit devices to measure avoltage overshoot condition.

Computer system 102 includes communications fabric 402, which providescommunications between computer processor(s) 404, memory 406, persistentstorage 408, communications unit 410, and input/output (I/O)interface(s) 412. Communications fabric 402 can be implemented with anyarchitecture designed for passing data and/or control informationbetween processors (such as microprocessors, communications and networkprocessors, etc.), system memory, peripheral devices, and any otherhardware components within a system. For example, communications fabric402 can be implemented with one or more buses.

Memory 406 and persistent storage 408 are computer-readable storagemedia. In this embodiment, memory 406 includes random access memory(RAM) 414 and cache memory 416. In general, memory 406 can include anysuitable volatile or non-volatile computer-readable storage media.

Hypervisor 124 and CMM 130 may be stored in persistent storage 408 forexecution and/or access by one or more of the respective computerprocessors 404 via one or more memories of memory 406. In thisembodiment, persistent storage 408 includes a magnetic hard disk drive.Alternatively, or in addition to a magnetic hard disk drive, persistentstorage 408 can include a solid state hard drive, a semiconductorstorage device, read-only memory (ROM), erasable programmable read-onlymemory (EPROM), flash memory, or any other computer-readable storagemedia that is capable of storing program instructions or digitalinformation.

The media used by persistent storage 408 may also be removable. Forexample, a removable hard drive may be used for persistent storage 408.Other examples include optical and magnetic disks, thumb drives, andsmart cards that are inserted into a drive for transfer onto anothercomputer-readable storage medium that is also part of persistent storage408.

Communications unit 410, in these examples, provides for communicationswith other data processing systems or devices, including remote filesystem disk 106, 110, 114. In these examples, communications unit 410includes one or more network interface cards. Communications unit 410may provide communications through the use of either or both physicaland wireless communications links. Hypervisor 124 and CMM 130 may bedownloaded to persistent storage 408 through communications unit 410.

I/O interface(s) 412 allows for input and output of data with otherdevices that may be connected to server computer 102. For example, I/Ointerface 412 may provide a connection to external devices 418 such as akeyboard, keypad, a touch screen, and/or some other suitable inputdevice. External devices 418 can also include portable computer-readablestorage media such as, for example, thumb drives, portable optical ormagnetic disks, and memory cards. Software and data used to practiceembodiments of the present invention, e.g., hypervisor 124 and CMM 130,can be stored on such portable computer-readable storage media and canbe loaded onto persistent storage 408 via I/O interface(s) 412. I/Ointerface(s) 412 also connects to a display 420. Display 420 provides amechanism to display data to a user and may be, for example, a computermonitor.

The programs described herein are identified based upon the applicationfor which they are implemented in a specific embodiment of theinvention. However, it should be appreciated that any particular programnomenclature herein is used merely for convenience, and thus theinvention should not be limited to use solely in any specificapplication identified and/or implied by such nomenclature.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

What is claimed is:
 1. A computer program product for providing hintsfor page stealing by prioritizing pages based on the number ofresidences for the pages in a virtual environment comprising: one ormore computer readable non-transitory storage media; programinstructions stored on the one or more computer readable non-transitorystorage media, the program instructions comprising: program instructionsto receive a plurality of pages that are candidates to be hinted to ahypervisor for page stealing; program instructions to determine at leasttwo page types from the plurality of pages, wherein the page typeinclude at least one of Klock (Kernel pages), working segment pages,remote pages, and persistent pages; program instructions to determinewhether any of the at least two page types have a total number ofresidences less than a total number of potential residences in a virtualenvironment for all page types and have a total number of residencesless than a threshold, wherein the threshold is determined by a user ofthe virtual environment in real time, and wherein the total number ofpotential residences is the sum of readable residences and writeableresidences, and wherein the total number of residences include a pagingspace, a shared memory pool, and a main memory, and wherein the pagingspace comprises paging space found on a computer that hosts thehypervisor; and program instructions, responsive to determining a firstpage type of the at least two page types has a total number ofresidences less than a total number of potential residences in thevirtual environment for all page types and has a total number ofresidences less than a threshold, to notify the hypervisor of at leastone page, from the plurality of pages, that is of the first page type,and wherein the notification includes an indication that the at leastone page is an optimal candidate for page stealing.